package com.atguigu04.set.exer1;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * ClassName: ArrayList
 * Package: com.atguigu04.set.exer1
 * Description:
 *
 * @Author BuTang
 * @Create 2023/6/7 10:04
 * @Version 1.0
 */
public class SetTest {
    public static void main(String[] args) {
        ArrayList arraylist = new ArrayList();
        arraylist.add("bb");
        arraylist.add("aa");
        arraylist.add("aa");
        arraylist.add("bb");
        arraylist.add("gg");

        List newlist =  SetTest.duplicateList(arraylist);
        System.out.println(newlist);

    }
    public static List duplicateList(List list){
        Set s = new HashSet(list);
        ArrayList a = new ArrayList(s);
        return a;
    }
}
